#ifndef TreeItem_H
#define TreeItem_H

#include "..\..\core\src\AssetManager.h"
#include <QtGui>

enum ModelItemType 
{
	QUESTIONS_ROOT,
	ATTRIBUTES_ROOT, 
	RESULTS_ROOT, 
	QUESTION, 
	ATTRIBUTE, 
	RESULT, 
	RESPONSE,
	RESPONSE_ATTRIBUTE
};

namespace Xps
{
	class TreeItem : public QStandardItem
	{
		ModelItemType type;

	protected:
		XpsAssets::AssetManager* am;
		
		/// item id
		int id;

		/// parent item id
		int pid;

	public:
		XpsAssets::AssetData* asset;

		TreeItem(XpsAssets::AssetManager* am, int id, ModelItemType type, int pid = -1);
		
		/// get data override
		virtual QVariant data(int role) const;
		
		/// set data override
		void setData(const QVariant & value, int role = Qt::UserRole);
		
		/// returns the asset id
		int getID();

		/// returns the model item type
		int getType();
	};
}
#endif